package org.dormi.learn;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

/**
 * @author : dormi330
 * @since : 22/04/18
 */
public class FutureDemo01 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        System.out.println("t1=" + System.currentTimeMillis());
        Future<String> future = new TestFuture<>("x", 3000);;
        String s = future.get();
        System.out.println("s=" + s);
        System.out.println("t2=" + System.currentTimeMillis());
    }

}
